package com.ruoyi.admin.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.admin.domain.dto.QuotaTypeDto;
import com.ruoyi.admin.domain.entity.SchedulingModel;
import com.ruoyi.admin.domain.vo.request.scheduling.SchedulingPageJoinRequest;
import com.ruoyi.admin.domain.vo.response.scheduling.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * 排单(Scheduling) Mapper类
 *
 * @author jianhan
 * @date 2022-12-07 15:41:40
 */
@Mapper
public interface SchedulingMapper extends BaseMapper<SchedulingModel> {


    /** 分页连表查询 */
    Page<SchedulingPageJoinResponse> queryPage(IPage<SchedulingPageJoinRequest> page, @Param("req") SchedulingPageJoinRequest schedulingPageJoinRequest);

    SchedulingPageJoinResponse getJoinById(Long schedulingId);

    /** 本月毛利查询 */
    ProfitMonthResponse thisMonthGrossProfit();

    /** 上月毛利查询 */
    ProfitMonthResponse lastMonthGrossProfit();

    /** 今年毛利查询 */
    ProfitMonthResponse thisYearGrossProfit();

    /** 本季度毛利查询 */
    ProfitMonthResponse thisQuarterGrossProfit();

    /** 今日额度查询 */
   List<QuotaTypeDto> getQuotaTypeToday();

    /** 本月额度查询 */
    List<QuotaTypeDto> getQuotaTypeMonth();

    List<SupplierQuotaResponse> getSupplierQuota();

    List<HotListResponse> getHotList();

    List<SchedulingModel> getTodayPending();

    List<SchedulingModel> getYesterdayPending();

    List<DayTotalResponse> getTotalGroupByDay();
}
